package com.orangeforms.webadmin.app.model;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.orangeforms.common.core.base.mapper.BaseModelMapper;
import com.orangeforms.common.core.util.MyCommonUtil;
import com.orangeforms.webadmin.app.vo.SysProjectVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Date;

/**
 * (SysProject)表实体类
 *
 * @author makejava
 * @since 2022-08-10 16:04:51
 */
@SuppressWarnings("serial")
@TableName("sys_project")
@Data
public class SysProject{
     /**
     * 项目id
     */
    @TableField(value = "id")
    private Long id;
     /**
     * 项目名称
     */
    @TableField(value = "name")
    private String name;
     /**
     * 上级部门ID，一级部门为0
     */
    @TableField(value = "parent_id")
    private Long parentId;
     /**
     * 子项目id
     */
    @TableField(value = "child_ids")
    private String childIds;
     /**
     * 项目编码
     */
    @TableField(value = "code")
    private String code;
     /**
     * 项目时期（十二五：0；十三五：1；十四五：2）
     */
    @TableField(value = "project_period")
    private Integer projectPeriod;
     /**
     * 公路等级
     */
    @TableField(value = "road_level")
    private String roadLevel;
     /**
     * 前期施工图阶段数（1：一阶段；2：两阶段）
     */
    @TableField(value = "drawing_level")
    private Integer drawingLevel;
     /**
     * 排序
     */
    @TableField(value = "order_num")
    private Integer orderNum;
     /**
     * 序号2（用于子项目排序）
     */
    @TableField(value = "order_num_2")
    private Integer orderNum2;
     /**
     * 项目概况
     */
    @TableField(value = "project_summary")
    private String projectSummary;
     /**
     * 创建者id
     */
    @TableField(value = "creator_id")
    private Long creatorId;
     /**
     * 创建时间
     */
    @TableField(value = "gmt_create")
    private Date gmtCreate;
     /**
     * 状态标记
     */
    @TableField(value = "status")
    private Integer status;
     /**
     * 开工令日期
     */
    @TableField(value = "start_date")
    private Date startDate;
     /**
     * 交工日期
     */
    @TableField(value = "finish_date")
    private Date finishDate;
     /**
     * 竣工日期
     */
    @TableField(value = "end_date")
    private Date endDate;
     /**
     * 建设单位
     */
    @TableField(value = "build_id")
    private Long buildId;
     /**
     * 总公司
     */
    @TableField(value = "head_office_id")
    private Long headOfficeId;
     /**
     * 简称
     */
    @TableField(value = "shorthand")
    private String shorthand;
     /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;
     /**
     * 路基宽度
     */
    @TableField(value = "subgrade_width")
    private String subgradeWidth;
     /**
     * 路面形式
     */
    @TableField(value = "pavement")
    private Integer pavement;
     /**
     * 立项依据
     */
    @TableField(value = "file_id")
    private String fileId;
     /**
     * 项目阶段
     */
    @TableField(value = "phase")
    private String phase;
     /**
     * 实际开工日期
     */
    @TableField(value = "work_date")
    private Date workDate;
     /**
     * 立项时间
     */
    @TableField(value = "approval_date")
    private Date approvalDate;
     /**
     * 负责人
     */
    @TableField(value = "manager")
    private String manager;
     /**
     * 联系方式
     */
    @TableField(value = "contact")
    private String contact;
     /**
     * 项目里程（公里）
     */
    @TableField(value = "length")
    private Double length;
     /**
     * 实际建设里程
     */
    @TableField(value = "actual_construction_length")
    private Double actualConstructionLength;
     /**
     * 完全利用段里程
     */
    @TableField(value = "complete_used_length")
    private Double completeUsedLength;
     /**
     * 批复预算（万元）
     */
    @TableField(value = "replay_invest")
    private Double replayInvest;
     /**
     * 追加预算(万元)
     */
    @TableField(value = "add_invest")
    private Double addInvest;
     /**
     * 结算总投资（万元）
     */
    @TableField(value = "settle_invest")
    private Double settleInvest;
     /**
     * 决算金额（万元）
     */
    @TableField(value = "final_accounts_amount")
    private Double finalAccountsAmount;
     /**
     * 文号
     */
    @TableField(value = "doc_no")
    private String docNo;
     /**
     * 工可批复文号
     */
    @TableField(value = "permit_approval_number")
    private String permitApprovalNumber;
     /**
     * 初步设计文号
     */
    @TableField(value = "initial_design_approval_number")
    private String initialDesignApprovalNumber;
     /**
     * 施工图设计批复文号
     */
    @TableField(value = "drawing_design_approval_number")
    private String drawingDesignApprovalNumber;
     /**
     * 甲供材料预算（万元）
     */
    @TableField(value = "proprietors_supply_materials_budget")
    private Double proprietorsSupplyMaterialsBudget;
     /**
     * 合同金额（元）
     */
    @TableField(value = "contract_amount")
    private Double contractAmount;
     /**
     * 下浮费（元）
     */
    @TableField(value = "down_float_fee")
    private Double downFloatFee;
     /**
     * 合同暂定金额（元）
     */
    @TableField(value = "provisional_amount")
    private Double provisionalAmount;

    @TableField(exist = false)
    private String searchString;

    /**
     * birthday 范围过滤起始值(>=)。
     */
    @TableField(exist = false)
    private String gmtCreateStart;

    /**
     * birthday 范围过滤结束值(<=)。
     */
    @TableField(exist = false)
    private String gmtCreateEnd;

    public void setSearchString(String searchString) {
        this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
    }

    @Mapper
    public interface SysProjectModelMapper extends BaseModelMapper<SysProjectVo,SysProject> {
        @Override
        SysProject toModel(SysProjectVo sysProjectVo);
        @Override
        SysProjectVo fromModel(SysProject sysProject);
    }
    public static final SysProjectModelMapper INSTANCE = Mappers.getMapper(SysProjectModelMapper.class);

}

